//
//  HomePicDetailFourCell.m
//  ioschishan
//
//  Created by 马田成 on 2017/7/31.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "HomePicDetailFourCell.h"

@implementation HomePicDetailFourCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self layoutUI];
    }
    return self;
}
- (void)layoutUI{

    //点赞
    self.buttonZan = [[UIButton alloc] init];
    [self.contentView addSubview:self.buttonZan];
    [self.buttonZan mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(15);
        make.left.equalTo(self.contentView).with.offset(37);
        make.height.offset(20);
        make.width.offset(20);
        
    }];    
    [self.buttonZan setBackgroundImage:[UIImage imageNamed:@"thumb-up_icon"] forState:UIControlStateNormal];
    
    self.labelZan = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelZan];
    [self.labelZan mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.buttonZan.mas_bottom).with.offset(5);
        make.centerX.equalTo(self.buttonZan.mas_centerX);
        make.height.offset(10);
        
    }];
    self.labelZan.textAlignment = NSTextAlignmentCenter;
    self.labelZan.text = @"555";
    self.labelZan.font = [UIFont systemFontOfSize:10];
    self.labelZan.textColor = getColor(@"9B9B9B");
    
    //评论
    self.buttonPing = [[UIButton alloc] init];
    [self.contentView addSubview:self.buttonPing];
    [self.buttonPing mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(15);
        make.height.offset(20);
        make.width.offset(20);
        make.left.equalTo(self.buttonZan.mas_right).with.offset((DEF_SCREEN_WIDTH - 74 - 80) / 3);
        
    }];
    [self.buttonPing setBackgroundImage:[UIImage imageNamed:@"review_icon"] forState:UIControlStateNormal];
    
    self.labelPing = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelPing];
    [self.labelPing mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.buttonPing.mas_bottom).with.offset(5);
        make.centerX.equalTo(self.buttonPing.mas_centerX);
        make.height.offset(10);
        
    }];
    self.labelPing.textAlignment = NSTextAlignmentCenter;
    self.labelPing.text = @"555";
    self.labelPing.font = [UIFont systemFontOfSize:10];
    self.labelPing.textColor = getColor(@"9B9B9B");
    
    //分享
    self.buttonFen = [[UIButton alloc] init];
    [self.contentView addSubview:self.buttonFen];
    [self.buttonFen mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(15);
        make.height.offset(20);
        make.width.offset(20);
        make.left.equalTo(self.buttonPing.mas_right).with.offset((DEF_SCREEN_WIDTH - 74 - 80) / 3);
        
    }];
    [self.buttonFen setBackgroundImage:[UIImage imageNamed:@"share_icon"] forState:UIControlStateNormal];
    
    self.labelFen = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelFen];
    [self.labelFen mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.buttonFen.mas_bottom).with.offset(5);
        make.centerX.equalTo(self.buttonFen.mas_centerX);
        make.height.offset(10);
        
    }];
    self.labelFen.textAlignment = NSTextAlignmentCenter;
    self.labelFen.text = @"555";
    self.labelFen.font = [UIFont systemFontOfSize:10];
    self.labelFen.textColor = getColor(@"9B9B9B");
    //打赏
    self.buttonDa = [[UIButton alloc] init];
    [self.contentView addSubview:self.buttonDa];
    [self.buttonDa mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(15);
        make.height.offset(20);
        make.width.offset(20);
        make.right.equalTo(self.contentView).with.offset(-37);
        
    }];
    [self.buttonDa setBackgroundImage:[UIImage imageNamed:@"gift_icon"] forState:UIControlStateNormal];
    
    self.labelDa = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelDa];
    [self.labelDa mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.buttonDa.mas_bottom).with.offset(5);
        make.centerX.equalTo(self.buttonDa.mas_centerX);
        make.height.offset(10);
        
    }];
    self.labelDa.textAlignment = NSTextAlignmentCenter;
    self.labelDa.text = @"打赏";
    self.labelDa.font = [UIFont systemFontOfSize:10];
    self.labelDa.textColor = getColor(@"9B9B9B");
    
    UIView *viewLine = [[UIView alloc] init];
    [self.contentView addSubview:viewLine];
    [viewLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelDa).with.offset(15);
        make.left.equalTo(self.contentView).with.offset(15);
        make.height.offset(1);
        make.right.equalTo(self.contentView);
        
        
    }];
    viewLine.backgroundColor = getColor(@"F5F5F5");
    
    self.pic1 = [[UIImageView alloc] init];
    [self.contentView addSubview:self.pic1];
    self.pic1.image = [UIImage imageNamed:@"3479.jpg_wh1200"];
    [self.pic1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(viewLine.mas_bottom).with.offset(25);
        make.left.equalTo(self.contentView).with.offset(15);
        make.height.offset(26);
        make.width.offset(26);
        
    }];
    self.pic1.layer.cornerRadius = 13.0f;
    self.pic1.layer.masksToBounds = YES;
    
    
    
    self.pic2 = [[UIImageView alloc] init];
    [self.contentView addSubview:self.pic2];
    [self.pic2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(viewLine.mas_bottom).with.offset(25);
        make.left.equalTo(self.pic1.mas_right).with.offset(8);
        make.height.offset(26);
        make.width.offset(26);
        
    }];
    self.pic2.layer.cornerRadius = 13.0f;
    self.pic2.layer.masksToBounds = YES;
    
    self.pic3 = [[UIImageView alloc] init];
    [self.contentView addSubview:self.pic3];
    [self.pic3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(viewLine.mas_bottom).with.offset(25);
        make.left.equalTo(self.pic2.mas_right).with.offset(8);
        make.height.offset(26);
        make.width.offset(26);
        
    }];
    self.pic3.layer.cornerRadius = 13.0f;
    self.pic3.layer.masksToBounds = YES;
    
    
    self.buttonMone = [[UIButton alloc] init];
    [self.contentView addSubview:_buttonMone];
    [_buttonMone mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(viewLine.mas_bottom).with.offset(15);
        make.left.equalTo(self.pic3.mas_right).with.offset(20);
        make.height.offset(26);
        make.right.equalTo(self.contentView).with.offset(-15);
        
    }];
    
    UIImageView *img = [[UIImageView alloc] init];
    [self.contentView addSubview:img];
    img.image = [UIImage imageNamed:@"arrow_icon"];
    
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(viewLine.mas_bottom).with.offset(25);
        make.right.equalTo(self.contentView).with.offset(-15);
        
        
    }];
    
    
    
    
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
